<?php

 class SearchFieldsShotModel {
 	
 	public $year;
 	public $month;
 	public $day;
 	public $tag;
 	public $id;
 	private $is_tag_query;
 	public $date_count;
 	private $is_date_query;
 	
 	
 	public function __construct($y="",$m="",$d="",$t="",$id="") {
 		$this->year = $y;
 		$this->month = $m;
 		$this->day=$d;
 		$this->tag = $t; 	
 		$this->id = $id; 	
 		$this->is_tag_query = (bool)( !empty($t));
 		$this->is_date_query = (bool) !(empty($y));
 		$this->date_count =(int) (!empty($d)) ? 3 : (!empty($m) ? 2 : 1);
 		
 		
 	}
 	 	
 	public function isTagQuery(){
 		return $this->is_tag_query;
 	}
 	
 	public function isDateQuery(){
 		return $this->is_date_query;
 	}
 	
 	public function __toString(){
 		$t = "";
 		$s ="";
 		if($this->is_tag_query)
 			$t = "yes";
 		else $t="no";
 		
 		if($this->is_date_query)
 			$s="yes";
 		else
 			$s="no";
 		$value = "";
 		$value .= "year : " ;$this->year;
 		$value .= "<br />month : " ;$this->month;
 		$value .= "<br />day : " ;$this->day;
 		$value .= "<br />tag : " ;$this->tag;
 		$value .= "<br />id : " ;$this->id;
 		$value .= "<br />tag query ? : " .  $t;
 		$value .= "<br />date query  : " .$s;
 		$value .= "<br />date count ? : " ;$this->date_count;

 		return $value;
 		
 	}
 	
 }